package com.filldream.fastboot.common.okutil.cls.dto;

import com.filldream.fastboot.common.util.TransferUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.ObjectUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Data
public class ClsNews {

    @ApiModelProperty(value = "以往资讯")
    private List<DepthList> depthList;

    @ApiModelProperty(value = "热门资讯")
    private List<TopArticle> topArticle;

    @ApiModelProperty(value = "所有文章ID列表")
    public List<Long> getAllId(){
        List<Long> ids = new ArrayList<>();
        if(ObjectUtils.isNotEmpty(depthList)){
            ids.addAll(depthList.stream().map(DepthList::getId).collect(Collectors.toList()));
        }
        if(ObjectUtils.isNotEmpty(topArticle)){
            ids.addAll(topArticle.stream().map(TopArticle::getId).collect(Collectors.toList()));
        }
        return ids;
    }



}
